<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Welcome</title>
</head>

<script language="JavaScript">
	function idandtitleunres(id) {
		document.getElementById("idUnres1").value=id;
	}
</script>

<script language="JavaScript">
	function idandtitleres(id) {
		document.getElementById("idRes1").value=id;
	}
</script>

<body>
<s:if test="#session.loggedin != 'true'">
            <jsp:forward page="/index.jsp" />
        </s:if>
<h1>Reviewer: <s:property value="#session.user.getName()" /> <s:property value="#session.user.getSecondName()" /></h1>
<hr>

<h4>Notifications: <s:property value="notifications" /> </h4>
<hr>
	<jsp:include page="header.jspf"></jsp:include>
<hr>

<h3>Unresolved Publications</h3>
	<s:form action="showUnresolved">
		<s:submit value="Consult" ></s:submit>
		</s:form>
			<table border="1">
			<s:if test="foundUnres==true">
				<tr>
					<td>IdArticle</td>
					<td>Date</td>
					<td>Mark</td>
					<td>Asses?</td>
				</tr>
			</s:if>
			<s:iterator value="articleReviewList" status="itStatus">
				<tr>
					<td><s:property value="getIdArticle()" /></td>
					<td><s:property value="getReview_date()" /></td>
					<td><s:property value="getMark()" /></td>
					<td><a href="javascript:idandtitleunres('<s:property value="getIdArticle()" />')">Yes</a>
				</tr>
			</s:iterator>
		</table>
		<s:form action="assesPublication">
			<s:textfield id="idUnres1" name="idUnres" label="IdArticle"/>
			<s:combobox name="cbmarks" label="Mark" headerValue="Select a Mark" list="{'0','1','2','3','4','5','6','7','8','9','10'}"/>
			<s:submit name="setMark" value="Put Mark"/>
		</s:form>


<h3>Reviewed Publications</h3>
	<s:form action="showResolved">
		<s:submit value="Consult" ></s:submit>
		</s:form>
			<table border="1">
			<s:if test="foundRes==true">
				<tr>
					<td>Date</td>
					<td>IdArticle</td>
					<td>Mark</td>
					<td>Comment</td>
					<td>Leave a Comment?</td>
				</tr>
			</s:if>
			<s:iterator value="reviewList" status="itStatus">
				<tr>
					<td><s:property value="getReview_date()" /></td>
					<td><s:property value="getIdArticle()" /></td>
					<td><s:property value="getMark()" /></td>
					<td><s:property value="getComment()" /></td>
					<td><a href="javascript:idandtitleres('<s:property value="getIdArticle()" />')">Yes</a></td>
				</tr>
			</s:iterator>
		</table>
		<s:form action="commentPublication">
			<s:textfield id="idRes1" name="idres" label="IdArticle" />
			<s:textarea name="commenttext" label="Write a comment" cols="30" rows="5"/>
			<s:submit name="setComment" value="Send Comment" />
		</s:form>



</body>
</html>